﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using S.Eartag.API.Application.Command.LamBingCommand;
using S.Eartag.API.Application.Command.SheepFileConditionCommand;

namespace S.Eartag.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class LamBingController : ControllerBase
    {
        private readonly IMediator mediator;

        public LamBingController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 产羔耳标管理-新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> LamBingCreate(LamBingCreateCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        ///  产羔耳标管理-删除
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpDelete]
         public async Task<int> LamBingDelete([FromQuery]LamBingDeleteCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 产羔耳标管理-修改
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPut]
        public async Task<int> LamBingUpdate(LamBingUpdateCommand request)
        {
            return await mediator.Send(request);
        }
        [HttpPut]
        public async Task<int> LamBingAllDel([FromQuery]LamBingAllDelCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPut]
        public  async Task<int> LamBingUpdates([FromQuery]LamBingUpdatesCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
